using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
namespace Ascent.Module.BusinessObjects.Base
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("基础数据")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("产品类")]
  public partial class ProductCategory : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private Ascent.Module.BusinessObjects.Base.Product _product;
    private System.String _remarks;
    private System.String _categoryName;
    public ProductCategory(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("产品类名称")]
    public System.String CategoryName
    {
      get
      {
        return _categoryName;
      }
      set
      {
        SetPropertyValue("CategoryName", ref _categoryName, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remarks
    {
      get
      {
        return _remarks;
      }
      set
      {
        SetPropertyValue("Remarks", ref _remarks, value);
      }
    }
    public Ascent.Module.BusinessObjects.Base.Product Product
    {
      get
      {
        return _product;
      }
      set
      {
        if (_product == value)
          return;
        Ascent.Module.BusinessObjects.Base.Product prevProduct = _product;
        _product = value;
        if (IsLoading)
          return;
        if (prevProduct != null && prevProduct.ProductCategory == this)
          prevProduct.ProductCategory = null;
        if (_product != null)
          _product.ProductCategory = this;
        OnChanged("Product");
      }
    }
  }
}
